c=input()
s=input()
flag=0
for i in range(len(s)-1,-1,-1):
    if s[i]==c:
        print("index = %d"%i)
        flag=1
        break
if flag==0:
    print("Not Found")